import {PluginCommand} from "../PluginCommand";

class ElementLibraryCommand extends PluginCommand {
  constructor() {
    super();
  }

  /**
   * 获取要素库中所有的文件夹
   * @param cb
   */
  executeElementLibraryCommand(params, cb) {
    if(this.toolQuery){
      this.toolQuery.executeElementLibraryCommand(params, this.commandId).then(res => {
        cb(res.data.data);
      })
    }
  }
  /**
   * 通过要素库插入对应零件
   * @param cb
   */
  executeInsertLibPartCommand(params,cb){
    if(this.toolQuery){
      params.commandId = this.commandId;
      this.toolQuery.elementLibraryPartInsert(params).then(res => {
        cb(res.data.data);
      })
    }
  }
}

const elementLibraryCmd = new ElementLibraryCommand();
export {elementLibraryCmd}